using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class main_button : MonoBehaviour
{
    private bool floor;
    public List<GameObject> gameObjects;
    void Start()
    {
        AudioMgr.Instance.PlayGameBgm(AudioBgmType.MainMenuBgm);
        floor = true;
        open_close.canvas_open(gameObjects[0]);
        open_close.canvas_close(gameObjects[1]);
        open_close.canvas_close(gameObjects[2]);
        open_close.canvas_close(gameObjects[3]);
        open_close.canvas_close(gameObjects[4]);
        open_close.canvas_close(gameObjects[5]);
        open_close.canvas_close(gameObjects[6]);
    }
    public void StartButtonClick()
    {
        open_close.canvas_open(gameObjects[1]);
        open_close.canvas_open(gameObjects[2]);
        open_close.canvas_open(gameObjects[4]);
        open_close.canvas_close(gameObjects[0]);
        open_close.canvas_close(gameObjects[3]);
        open_close.canvas_close(gameObjects[5]);
        floor = true;
        return;
    }

    //public void HandboolButtonClick()
    //public void SearchButtonClick()
    //public void MenuButtonClick()
    public void ExitButtonClick()
    {
        CanvasGroup c = gameObjects[6].GetComponent<CanvasGroup>();
        c.alpha = 0.5f;
        c.blocksRaycasts = true;
        c.interactable = true;
        return;
    }

    public void ReturnClick()
    {
        if (floor)
        {
            Start();
        }
        else
        {
            StartButtonClick();
        }
        return;
    }
    public void StoryClick()
    {
        open_close.canvas_close(gameObjects[2]);
        open_close.canvas_close(gameObjects[4]);
        open_close.canvas_open(gameObjects[3]);
        floor = false;
        return;
    }

    public void ChallengeClick()
    {
        open_close.canvas_close(gameObjects[2]);
        open_close.canvas_close(gameObjects[4]);
        open_close.canvas_open(gameObjects[5]);
        floor = false;
        return;
    }
}
